package automakelist;

import com.alibaba.fastjson.JSON;
import com.github.timeloveboy.utils.Log;
import config.Config;
import model.curriculum;

import java.util.Date;

/**
 * 均分算法，适用于学员不允许切换教练的配置模式
 * 先 平均分配学员给教练、再分配教练的时间给这些学员
 * Created by root on 17-6-14.
 */
public class examsdays implements Icurriculummaker {
    curriculum result;
    Config c;
    Date startdate;

    public void newmaker(Config c, Date startdate) {
        this.c = c;
        this.startdate = startdate;
        result = new curriculum(c.coach_count, c.student_count);
        result = computing.spiltstudenttocoach_教练排满优先_预约考试时长(result, c);

        //再部署教练的每节课的学员
        result = computing.分配教练时间给他的学员(result, startdate, c);
        //生成循环 链表
        for (int i_coach = 0; i_coach < c.coach_count; i_coach++) {
            result.coaches.get(i_coach).studentMap = null;
        }

        Log.v(JSON.toJSONString(result));
    }

    public curriculum get() {
        return result;
    }
}
